package First
// Int？可空类型，实际的默认值
data class Person(val name :String,val age :Int? = null) {
    fun main(args: Array<String>){
        val persons = listOf(Person("Alice"),Person("Bob",age = 29))
        //lambda表达式 如果age为null ?:会将age设置为0 maxBy函数查找到列表中年纪最大的
        val oldest = persons.maxBy { it.age ?: 0 }
        //$字符串模版
        println("The oldest is: $oldest")
    }
}